<template>
    <el-config-provider :locale="zhCn">
        <LayoutHeader v-if="!hideMenus"></LayoutHeader>
        <div :style="{ height: hideMenus ? '100%' : 'calc(100vh - 40px)', width: '100%' }">
            <RouterView v-slot="{ Component, route }">
                <KeepAlive>
                    <component :is="Component" :key="route.fullPath" v-if="route.meta.keepAlive" />
                </KeepAlive>
                <component v-if="!route.meta.keepAlive" :is="Component" :key="route.fullPath" />
            </RouterView>
        </div>
    </el-config-provider>
</template>

<script setup lang="ts">
import LayoutHeader from '@/components/LayoutHeader/index.vue'
import { useGlobalStore } from '@/stores/global'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
const globalStore = useGlobalStore()
const { hideMenus } = storeToRefs(globalStore)
</script>
